import { useStore } from 'vuex'
import { StateProp, SongDetailProp } from '@/store/type'
import { computed } from 'vue'
import { PLAY_MODE } from '@/assets/js/constant'
export default () => {
    const store = useStore<StateProp>()
    const payMode = computed<PLAY_MODE>(() => store.state.playMode) // 播放模式
    const modeClass = computed<string>(() => `icon-${PLAY_MODE[payMode.value]}`) // 播放mode class类
    const changeMode = () => {
        const mode = (payMode.value + 1) % 3
        store.dispatch('changeMode', mode)
    }
    return {
        modeClass,
        changeMode
    }
}
